require(["common", "jQuery", "coAjax"], function(jSouper, $, coAjax) {
	//进入编辑状态
	App.set("$Event.admin.to_edit", function(e) {
		App.set("$Cache.admininfo.is_edit", true);
	});
	//完成编辑，提交表单
	App.set("$Event.admin.post_edit", function(e) {
		var info = App.get("bus_loginer.info");
		coAjax.put(appConfig.bus.set_info_url, App.get("bus_loginer.info"), function(result) {
			// console.log(result);
			alert("success", "修改完成");
			App.set("bus_loginer", result.result)
			App.set("$Cache.admininfo.is_edit", false);
		}, function(errorCode, xhr, errorMsg) {
			switch (errorCode) {
				case "00025":
					alert("error", "登录超时");
					href.toLogin();
					break;
				case "00041":
					alert("error", "请检查您的身份证格式");
					break;
				case "00043":
					alert("error", "请检查您的邮箱格式");
					break;
				case "00044":
					alert("error", "请检查您的手机号码");
					break;
				default:
					alert("error", errorMsg);
			}
		});
	});
	//取消编辑
	App.set("$Event.admin.cancel_edit", function(e) {
		coAjax.get(appConfig.bus.loginer, function(result) {
			App.set("bus_loginer", result.result);
		});
		App.set("$Cache.admininfo.is_edit", false);
	});

	App.set('$Event.check_alipay_info', function() {
		App.set('Private1', 'focus');
		App.set('Private2', '');
	});
	App.set('$Event.check_tenpay_info', function() {
		App.set('Private1', 'focus');
		App.set('Private2', 'focus');
	});
	App.set('$Event.close_pay_info', function() {
		App.set('Private1', '');
		App.set('Private2', '');
	})
})